{extend name="template/base" /}
{block name="content"}
<div class="page-container">
    {include file="form" /}
    <div class="cl pd-5 bg-1 bk-gray">
        <span class="l">
            {tp:menu menu="add,forbid,resume,delete,recyclebin" /}
        </span>
        <span class="r pt-5 pr-5">
            共有数据 ：<strong>{$count ?? '0'}</strong> 条
        </span>
    </div>
    <table class="table table-border table-bordered table-hover table-bg mt-20">
        <thead>
        <tr class="text-c">
            {include file="th" /}
            <th width="70">操作</th>
        </tr>
        </thead>
        <tbody>
        {volist name="list" id="vo"}
        <tr class="text-c">
            {include file="td" /}
            <td class="f-14">
                {if ($vo['status'] == 1)}
                    <a href="javascript:;" onclick="forbid({$vo.id})" class="label label-warning radius" title="点击禁用">禁用</a>
                {else /}
                     <a href="javascript:;" onclick="restore({$vo.id})" class="label label-primary radius" title="点击恢复">恢复</a>
                {/if}
                {tp:menu menu='sedit' /}
                {tp:menu menu='sdelete' /}
                <a title="修改密码" href="javascript:;" onclick="layer_open('修改密码','/admin/admin_user_info/edit_password/id/{$vo.id}.html',{w:'450px',h:'350px'})" style="text-decoration:none" class="ml-5 label label-primary radius">修改密码</a>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="page-bootstrap">{$page ?? ''}</div>
</div>
{/block}
{block name="script"}
<script>
    function forbid(id) {
        var url = '/admin/admin_user_info/forbid';
        $.ajax({
            type: 'get',
            url: url,
            data: {id:id},
            success: function (data) {
                layer.msg(data.msg)
                location.reload()
            }
        });
    }
    function restore(id) {
        var url = '/admin/admin_user_info/restore';
        $.ajax({
            type: 'get',
            url: url,
            data: {id:id},
            success: function (data) {
                layer.msg(data.msg)
                location.reload()
            }
        });
    }
</script>
{/block}

